package com.zyh.fengzhuanghejichengzuoye.test2.domain;

public class Circle {
    private double radius;

    //构造方法
    public Circle() {
    }

    public Circle(double radius) {
        this.radius = radius;
    }

    //成员方法
    //获取圆的面积
    public double getArea(){
        return Math.PI*Math.pow(getRadius(),2);
    }

    // 获取圆的周长
    public double getPerimeter(){
        return Math.PI*getRadius()*2;
    }

    //show()
    public void show(){
        System.out.println("圆的半径："+getRadius()+"圆的周长："+getPerimeter()+"圆的面积："+getArea());
    }

    //getter and setter

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }
}
